Network Environment

  When the HTTP protocol is in the public network, the public server cannot actively send requests to local area network devices. The URL in the configuration section can only be accessed/used normally in the local area network

Device Configuration

Server Configuration

  The configuration of server related parameters can be set through the webpage on the device side, as shown in the following figure:

Field explain
Agreement Protocol, currently only supports HTTP
Server address Server address, which can be IP or domain name
URL path Event reporting URL, please confirm on the server side
Port server port
Authentication mode If "none" is selected, authentication will be enabled. Choosing "key" and "device token" is mandatory. If not selected, it can be left blank
Secret key Device key, please confirm on the server side
Device token Device token, usually the device SN
Timeout period Device heartbeat timeout time
Registration status Device registration status

Server configuration

The test server is implemented in Java and requires setting up a Java environment, taking the Windows platform as an example

Download jdk

link:Java Downloads | Oracle

Install jdk

Configure environment variables

Enter advanced system settings, shortcut key win+i ->system settings ->advanced system settings, configure JAVA_SOME in the system variable

Set the PATH variable to add the bin directory of JRE to the existing PATH environment variable

java Environmental testing

open cmd,inputjava -version,Press enter and the following image will appear, indicating successful configuration

Download Test Server

link:https://xrs-public-bucket.obs.cn-south-1.myhuaweicloud.com/Temp/http-event-server.zip

decompression

Extract the compressed file to a separate directory

Test Server Configuration File Description

parameter describe
user_secret01 Secret key
passengerStaticsInterval Passenger flow statistics event interval
heartBeatInterval heartbeat interval
isEnableElectronicDefence Electronic fence incident reporting switch; True - report, false - do not report
isCrossBorderDetectEnable Cross border detection event reporting switch; True - report, false - do not report
isOffDutyDetectEnable OffDuty Detect Event reporting switch; True - report, false - do not report
isPassengerFlowStaticsEnable Passenger Flow Statics Event reporting switch; True - report, false - do not report
isCryScreamDetectEnable Cry Scream Detect Event reporting switch; True - report, false - do not report
isPetDetectEnable Pet Detect Event reporting switch; True - report, false - do not report
isFallDetectEnable Fall Detect Event reporting switch; True - report, false - do not report
isSnapshotEnable Snapshot Event reporting switch; True - report, false - do not report
isPersonInfoEnable Person Info Event reporting switch; True - report, false - do not report
isPersonDetectEnable Person Detect Event reporting switch; True - report, false - do not report
isCarLicenseSnapshotEnable Car License Snapshot Event reporting switch; True - report, false - do not report
isCarDetectEnable Car DetectEvent reporting switch; True - report, false - do not report
isMotionDetectEnable Motion Detect Event reporting switch; True - report, false - do not report
isTrafficStatisticsEnable Traffic Statistics Event reporting switch; True - report, false - do not report
isTrafficStatisticsCarShapeEnable Traffic Statistics Car Shape Event reporting switch; True - report, false - do not report
checkOAuth OAuth authentication switch; True authentication, false non authentication
eventSendMode Event sending mode; RealTime - Real time sending, false - Do not report

Run the test server

Open cmd and execute in the test server directoryjava -jar version,Press enter and the following image will appear, indicating that the test server has successfully started

Test equipment reporting function

Click the 'Test' button in the event center of the device's webpage, and the device will send a heartbeat request to the testing server

After receiving the heartbeat request from the device, the test server will print the heartbeat request information (as shown in the figure below) and respond with a heartbeat response to the device. Please refer to the specific content of the response message for details 心跳事件

Trigger event

After triggering an event on the device side, the device will report the event to the server, and the server will print the reported information upon receiving it, as shown in the following figure